﻿using System;

namespace HB.HttpServer
{
    /// <summary>
    /// 【覆盖特性】限制最大ContentLength，以字节为单位
    /// </summary>
    [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)]
    public class HttpMaxContentLength : Attribute
    {
        public int Length { get; set; }
        public bool NeedLimit { get; set; }
        public HttpMaxContentLength(int len)
        {
            Length = len;
            NeedLimit = true;
        }
        /// <summary>
        /// No Limit
        /// </summary>
        /// <param name="needLimit"></param>
        public HttpMaxContentLength(bool needLimit = false)
        {
            NeedLimit = false;
            Length = 1024;
        }
    
    }

}
